#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int Fib1(int n)
{
	if (n <= 2)
		return 1;
	else
		return Fib1(n - 1) + Fib1(n - 2);
}
int Fib2(int n)
{
	int a = 1;
	int b = 1;
	int c = 1;
	while (n > 2)
	{
		c = a + b;
		a = b;
		b = c;
		n--;
	}
	return c;
}
int main()
{
	int i = 0;
	scanf("%d", &i);
	int ret1 = Fib1(i);
	printf("%d", ret1);
	int ret2 = Fib2(i);
	printf("\n%d", ret2);
	return 0;
}